package com.example.sunmiv1.views;

import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.example.sunmiv1.R;
import com.example.sunmiv1.utils.Tools;

import butterknife.BindView;
import butterknife.ButterKnife;

public class TopPopWindow extends PopupWindow {
    TextView popWindowEdit;
    TextView popWindowDelete;
    private View mView;

    public TopPopWindow(Context paramActivity, View.OnClickListener paramOnClickListener) {
        mView = LayoutInflater.from(paramActivity).inflate(R.layout.popwindow_top, null);
        if (paramOnClickListener != null) {
            //設置點擊監聽
            setContentView(mView);
            popWindowEdit = mView.findViewById(R.id.popWindow_edit);
            popWindowDelete = mView.findViewById(R.id.popWindow_delete);
            //設置寬度
            setWidth(Tools.dp2px(100));
            //設置高度
            setHeight(Tools.dp2px(70));
            //設置顯示隱藏動畫
            popWindowEdit.setOnClickListener(paramOnClickListener);
            popWindowDelete.setOnClickListener(paramOnClickListener);
            //設置背景透明
            setBackgroundDrawable(new ColorDrawable(0));
        }
    }
}
